import { BasicColumn, FormSchema } from '@/components/Table';
import { h, ref } from 'vue';
import { Tag } from 'ant-design-vue';
import {VxeFormItemProps, VxeGridPropTypes} from "@/components/VxeTable";
import util from "@/utils/util";
import { deptSelectList } from '@/api/sys/iot';


/**
 */
export const vxeTableColumns: VxeGridPropTypes.Columns = [
  {
    title: '网关地址',
    field: 'gatewayMac',
    showOverflow: 'title',
    align: 'center',
    width: 120,
  },
  {
    title: '网关是否响应',
    field: 'responseFlag',
    align: 'center',
    formatter: ({ cellValue, row, column }) => {
      let val = "";
      switch (cellValue) {
        case 0:
          val = "否";
          break;
        case 1:
          val = "是";
          break;

      }
      return val;
    },
    width: 120,
  },
  {
    title: '部门名称',
    field: 'deptName',
    showOverflow: 'title',
    width: 130,
    align: 'center',
  },
  {
    title: '批号',
    field: 'batchNo',
    align: 'center',
    width: 120,

  },
  {
    title: '命令',
    field: 'cmd',
    align: 'center',
    width: 120,
  },
  {
    title: '标签MAC',
    field: 'tagMac',
    align: 'center',
  },
  {
    title: '成功标签',
    field: 'successTagMac',
    align: 'center',
  },
  {
    title: '失败标签',
    field: 'failTagMac',
    align: 'center',
  },
  {
    title: '创建时间',
    field: 'createTime',
    width: 130,
    align: 'center',
  },

  {
    width: 120,
    title: '操作',
    align: 'center',
    field: '',
    slots: { default: 'action' },
    fixed: 'right',
  },
];




export const vxeTableFormSchema: VxeFormItemProps[] = [
  {
    span: 5,
    field: 'name',
    title: '搜索',
    itemRender: {
      props: {
        placeholder: '名称',
      },
      name: 'AInput',
    },
  },

  {
    span: 5,
    itemRender: {
      name: 'VxeButtonGroup',
      options: [
        { type: 'reset', content: '重置' },
        { type: 'submit', content: '查询', status: 'primary' },
      ],
    },
  },
];

